<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width = device-width, initial-scale = 1.0, minimum-scale = 1.0, maximum-scale = 1.0, user-scalable = no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<title>求购发布</title>
<link type="text/css" href="css/reset.css" rel="stylesheet" />
<link type="text/css" href="css/public.css" rel="stylesheet" />
<link type="text/css" href="css/style.css" rel="stylesheet" />
<link type="text/css" href="css/wode.css" rel="stylesheet" />
<script>
    var deviceWidth = Math.min(640, window.innerWidth)
    document.documentElement.style.fontSize = deviceWidth / 7.5 + "px"
</script>
 <script src="js/jquery.min.js?v=2.1.4"></script>
 <script src="js/core.js"></script>
<script src="js/qiugoufabu.js"></script>
</head>
<body>

<!-- top -->
<div class="header">
    <header class="p_header public-red">
        <a href="javascript:history.go(-1);" class="p_header_left">
            <i class="p_left" title="返回"></i>
        </a>
        <h1 class="p_dizhi">求购发布</h1>
    </header>
</div>
<!--免费开店-->
<form>
	<input type="hidden" id="fengmian" />
	<div class="kaidian_dianpu" style="display: none;">
		<div class="fabu_fengmian">
			<div id="preview22">
	            <img id="imghead22" border=0 src="images/moren.jpg" />
	    </div>
	    <div class="fabu_file1"><input type="file" id="filess"  /></div>
		</div>
	</div>
	<div class="dingdan_title">样本图</div>
	<div class="mm_imgfile">
			<ul class="clearfix">
					<li>
							<img src="images/moren.jpg">
							<input type="file" onchange="previewImage2(this)">
					</li>
			</ul>
  </div>
	</div>
	<div class="dingdan_title">必填信息</div>
	<input type="hidden" id="shangquanid"/>
		<input type="hidden" id="dianhuahaoma2" value=""/>
	<div class="sell_fabu_guige">
		<ul>
			<li class="clearfix zhiweifabu01">
				<label>发布商圈</label>
				<span class="xingbie" id="zhizhis" onclick="xuanquids()">请选择</span>
				<div class="payment_time_mask payment_time_mask01" >
									<header class="p_header public-red">
											<a href="javascript:history.go(-1);" class="p_header_left">
													<i class="p_left" title="返回"></i>
											</a>
											<h1 class="p_dizhi">选择商圈(可多选)</h1>
									</header>
	                <ul id="shangquansssss">
	                </ul>
									<div class="a_addimg"><span class="p_left2" onclick="querenshang()">确定</span></div>
			</li>
			<li class="clearfix" id="showCityPicker">
				<label>商品分类</label>
				<span id="cityResult" >请选择</span>
				<!--<input type="hidden"  id="fenleis"/>-->
			</li>
				</ul>
	</div>

		<div class="sell_fabu_guige">
		<ul>
			
			<li class="clearfix">
				
				<label>联系电话 </label>  
				<span id="dianhua"  name="fr"></span>
				<input type="hidden" id="dianhuahaoma" />
				<div class="kaiguan" name="fr" onclick="yingchang(this)">
					<div class="kai">隐藏号码</div>
					<span class="yuan"></span>
					<span class="yuan1"></span>
					<div class="kai1">显示号码</div>
				</div>
			</li>
			<li class="clearfix">
				<label>微信号码</label>
				<input type="text" placeholder="请输入微信号码(非必填)" id="Backup"/>
			</li>
			<li class="clearfix">
				<label>联系人</label>
				<input type="text" placeholder="请输入联系人姓名(非必填)" id="username"/>
			</li>
			<li class="clearfix">
				<label>需要数量</label>
				<input type="number" placeholder="请输入商品数量" id="shuliang"/>
			</li>
			
	  <li class="clearfix" id="showCityPicker3">
            <label>需求地址</label> 
            <span id='cityResult3'>请选择</span><!--style="display: none;"-->
             
        </li>
		</ul>
	</div>
	<input type="hidden" id="is_hidden" value="0"/>
	<input type="hidden" id="sizeid" />
	<input type="hidden" id="colorid"/>
	<div class="dingdan_title">商品描述</div>
	<div class="sell_fabu_input">
		<textarea placeholder="这个款谁家有,有货的联系我!!!" id="miaoshu"></textarea>
	</div>

	
	<div class="sell_fabu_guige">
		<ul>
			<li class="clearfix color_li">
				<label>选择颜色</label>
				<span id="yanshes">请选择(非必填)</span>
			</li>
			<li class="clearfix chima_li">      
				<label>选择尺码</label>
				<span id="chimas">请选择(非必填)</span>
			</li>
			
		</ul>
	</div>
	
	<div class="mid-width qiugou_zhu" id="youxiaoshijian">注：每天免费10条求购</div>
	
	<div class="mid-width">
	    <input type="button" onclick="tijiao()" class="p_button" value="提交">
	</div>
	<div class="public-jianxi"></div>
</form>
<!--尺寸选择-->
<div class="p-chima chima_show">
	<h5>常用尺码</h5>
	<ul class="clearfix Chima" id="chaxunchima">
		
	</ul>
	<div class="p_chima_div clearfix">
		<input type="text" id="sizeName" placeholder="请输入新的尺码" />
		<input type="button" onclick="addNew2()" value="添加新尺码" />
	</div>
	<div class="mid-width">
		<input type="button" class="p_button" onclick="wanchengsize()" id="chima_hide" value="完成" />
	</div>
</div>

<!--颜色选择-->
<div class="p-chima color_show">
	<h5>常用颜色&nbsp;&nbsp;&nbsp;&nbsp;
	   <!-- <input id="full" /> -->
	</h5>
	<dl class="Color clearfix" id="chanyongshe">
	</dl>
	<div class="p_chima_div clearfix">
		<input type="text" id="Newcolor" placeholder="请输入颜色名称" />
		<input type="button" onclick="addNew()" value="添加新颜色" />
	</div>
	<div  class="mid-width">
		<input type="button" class="p_button" onclick="wanchengcolore()" id="color_hide" value="完成" />
	</div>
</div>

<div id="bg"></div>
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css" />
<link href="css/mui.picker.css" rel="stylesheet" />
<link href="css/mui.poppicker.css" rel="stylesheet" />
<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mui.picker.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mui.poppicker.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bank.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css" />
<link href="css/mui.picker.css" rel="stylesheet" />
<link href="css/mui.poppicker.css" rel="stylesheet" />
<script src="js/mui.min.js"></script>
<script src="js/mui.picker.js"></script>
<script src="js/mui.poppicker.js"></script>
<script src="js/city.data.js" type="text/javascript" charset="utf-8"></script>
<script src="js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
<script>
var maxCount = 1000;  // 最高字数，这个值可以自己配置
$("#miaoshu").on('keyup', function() {  /*其实不难，就是在键盘的keyup事件中获取现在输入字数的长度。*/
    var len = getStrLength(this.value);
    $("#tongji").html(maxCount-len);
})
 
// 中文字
function getStrLength(str) { 
    var len = str.length; 
    var reLen = 0; 
    for (var i = 0; i < len; i++) {        
        if (str.charCodeAt(i) < 27 || str.charCodeAt(i) > 126) { 
            // 全角    
            reLen += 2; 
        } else { 
            reLen++; 
        } 
    } 
    return reLen;    
}
	(function($, doc) {
		$.init();
		$.ready(function() {
			//级联示例
			var cityPicker3 = new $.PopPicker({
				layer: 3
			});
			cityPicker3.setData(cityData3);
			var showCityPickerButton = doc.getElementById('showCityPicker3');
			
			var cityResult3 = doc.getElementById('cityResult3');
			
			showCityPickerButton.addEventListener('tap', function(event) {
				cityPicker3.show(function(items) {
	cityResult3.innerHTML = (items[0] || {}).text + "" + (items[1] || {}).text + "" + (items[2] || {}).text;
					
					//return false;
				});
			}, false);
			
			//alert(cityResult3);
		});
	})(mui, document);
</script>
<!--上传-->
<script type="text/javascript" src="js/upload.js"></script>
<script type="text/javascript">
	var sun=0;
	$(".mm_imgfile input[type=file]").change(function(){
        var fs = this.files,$t  = $(this);
        $(fs).each(function(){
              var reader = new FileReader();
                reader.readAsDataURL(this);
                sun++;
                reader.onload = function(e) {
                    $t.parent().parent().prepend($('<li onclick="shanchu(this)"><input type="hidden"  class="classa" id="xijietu"/><img src="'+this.result+'"></li>'));
                }
        });
    });
    
    function shanchu(te){
    	//删除
    	$(te).remove();
    	
    } 
</script>

<link rel="stylesheet" type="text/css" href="Subsidiary/spectrum.css">
<script type="text/javascript" src="Subsidiary/jquery.min.js"></script>
<script type="text/javascript" src="Subsidiary/spectrum.js"></script>
<script type='text/javascript' src='Subsidiary/docs.js'></script>

</body>

<script type="text/javascript">
(function($, doc) {
		$.init();
		// 商品分类
		$.ready(function() {
     $.ajax({
     	async: false,
			url: urlcore + "/api/wantBuyType/selectWantBuyTypeTwoList",//wantBuyType/selectWantBuyTypeTwoList sortType/wxselectTwoList
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success:function(data){
		  	if (data.success == true) {
				  var goodsData="[";
				  $.each(data.data.list,function(y,n){
				  	if(y==0){
							goodsData+='{value:"'+n.id+'",text: "'+n.typeName+'"';
							if(n.wantBuyTypeList!=null){
								goodsData+=',children: [';
								$.each(n.wantBuyTypeList,function(q,m){
									 if(q==0){
										goodsData+='{value: "'+m.id+'",text: "'+m.typeName+'"}';
									 }else{
										goodsData+=',{value: "'+m.id+'",text: "'+m.typeName+'"}';
									 }
								});
								goodsData+=']';
							}
							goodsData+='}';
				  	}else{
							goodsData+=',{value:"'+n.id+'",text: "'+n.typeName+'"';
							if(n.wantBuyTypeList!=null){
								goodsData+=',children: [';
							 $.each(n.wantBuyTypeList,function(q,m){
									 if(q==0){
										goodsData+='{value: "'+m.id+'",text: "'+m.typeName+'"}';
									 }else{
									 goodsData+=',{value: "'+m.id+'",text: "'+m.typeName+'"}';
									 }
								});
								goodsData+=']';
							}
							goodsData+='}';
				  	}
				  })
				   goodsData+="]";
			    //级联示例
				  var cityPicker = new $.PopPicker({
				  layer: 2
			    });
	        // var arrs = ;	
	        var newData = eval(goodsData); //字符串形式的 转成数组
			    cityPicker.setData(newData);
			    var showCityPickerButton = doc.getElementById('showCityPicker');
			    var cityResult = doc.getElementById('cityResult');
			    showCityPickerButton.addEventListener('tap', function(event) {
					 cityPicker.show(function(items) {
							cityResult.innerHTML = items[0].text + '<p id="sopey" style="display: none;">'+items[1].value+'</p>' + items[1].text;
						//返回 false 可以阻止选择框的关闭
						//return false;
					 });
			    }, false);
			  }
		},
		error:function() {
			// Act on the event 
			alert("error");
		}
	});
	
	      });
	       
			})(mui,document);
	
	
// 尺码
// 弹出
$(".chima_li").on('click',function(){
        $("body").append("<div id='mask'></div>");
        $(".chima_show").show();
    })
//点击关闭
$("#chima_hide").on('click',function(){
        $(".chima_show").hide();
        $("#mask").remove();
    }) 
    
// 颜色
// 弹出
$(".color_li").on('click',function(){
        $("body").append("<div id='mask'></div>");
        $(".color_show").show();
    })
//点击关闭
 $("#color_hide").on('click',function(){
        $(".color_show").hide();
        $("#mask").remove();
    }) 	
	function xuanquids(){
	        $("#bg").css({
	            display: "block", height: $(document).height()
	        });
	        var $box = $('.payment_time_mask01');
	        $box.css({
	            display: "block",
	        });
	        $(".zhaopin_zpzw_em1").css("color","#04a6e9");
	        $(".zhiweifabu01 i").addClass("up");
	    
	}
	$(function () {
	   /* $(".zhiweifabu01>span").click(function () {});*/
	    //点击关闭按钮的时候，遮罩层关闭
	    $(".payment_time_mask01 li").on('click',function () {
	        $("#bg,.payment_time_mask01").css("display", "none");
	        $(".zhiweifabu01>span").text($(this).html());
	        $(".zhaopin_zpzw_em1").css("color","#04a6e9");
	        $(".zhiweifabu01 i").removeClass("up").addClass("down");
	    });
	    
	});
    $(".pay_ttl span").on('click',function () {
        $("#bg,.payment_time_mask").css("display", "none");
    });	
	//选择尺码
	$(document).ready(function(){                      
        $(".Chima li").each(function(){
            $(this).click(function () {
            	
                if ($(this).hasClass('ALL')) {
                    $(this).addClass('p_chima_curr').siblings().removeClass('p_chima_curr');
                }else{
                	$('.ALL').removeClass('p_chima_curr');
                    $(this).addClass('p_chima_curr');
                }
            }); 
        });
    });
	//颜色
	$('.Color dd').on('click',function(){
	    //给菜单添加选择样式
	    $(this).find('i').show();
	   
	}); 
	function shangquans(){
		window.location.href="shangquan.html";
	}
</script>
</html>